<?php
namespace App\Model;

use PhalApi\Model\NotORMModel as NotORM;

class WALLETIOC extends NotORM
{

    protected function getTableName($id)
    {
        return 'wallet_ico';
    }

    public function getIoc($ico = '') {
        $data = $this->getORM()->where(['ico' => $ico])->fetchOne();
        if(!empty($data))
            return $data;
    }

    public function getIocs()
    {
        $data = $this->getORM()->where(['type' => 1])->fetchAll();
        if(!empty($data))
            return $data;
    }

    public function getAllIoc()
    {
        $data = $this->getORM()->fetchAll();
        if(!empty($data))
            return $data;
    }

    public function getUrl()
    {
        $data = $this->getORM()->where('url_forprice != ?', '')->fetchAll();
        if(!empty($data))
            return $data;
    }
}